package GUILayer;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.FlowLayout;
import javax.swing.JTabbedPane;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.List;
import java.awt.Scrollbar;
import javax.swing.JList;
import javax.swing.Box;
import javax.swing.border.TitledBorder;
import javax.swing.UIManager;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import ControlLayer.*;
import ModelLayer.Customer;

public class western extends JFrame {

	private JPanel contentPane;
	private JTextField ProdIDTF;
	private JTextField ProdQNTF;
	private JTextField custCPRTF;
	private JTextField deliveryDateTF;
	private JTextField createCusCPRTF;
	private JTextField createCusfnameTF;
	private JTextField createCusLnameTF;
	private JTextField createCusAddressTF;
	private JTextField createCusPostalTF;
	private JTextField createCusPhoneTF;
	private JTextField createCusClubTF;
	private JTextField CreateProdIDTF;
	private JTextField CreateProdnameTF;
	private JTextField CreateProdPPriceTF;
	private JTextField CreateProdSpriceTF;
	private JTextField CreateProdRpriceTF;
	private JTextField CreateProdcountryTF;
	private JTextField CreateProdminstockTF;
	private JTextField CreateProdcurrentTF;
	private JTextField CreateProdsupcvrTF;
	private JTextField CreateSupcvrTF;
	private JTextField CreateSupnameTF;
	private JTextField CreateSupaddressTF;
	private JTextField CreateSupCountryTF;
	private JTextField CreateSupphoneTF;
	private JTextField CreateSupemailTF;
	private CustomerCtr customerCtr;
	private OrderCtr orderCtr;
	private SupplierCtr supplierCtr;
	private ProductCtr productCtr;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					western frame = new western();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public western() {
		supplierCtr = SupplierCtr.getInstance();
		customerCtr = CustomerCtr.getInstance();
		orderCtr = OrderCtr.getInstance();
		productCtr=ProductCtr.getInstance();
		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 563, 301);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new BorderLayout(0, 0));

		JPanel panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);
		panel.setLayout(new BorderLayout(0, 0));

		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		panel.add(tabbedPane);

		JPanel CreateOrderPane = new JPanel();
		tabbedPane.addTab("Create Order", null, CreateOrderPane, null);
		CreateOrderPane.setLayout(new BoxLayout(CreateOrderPane,
				BoxLayout.X_AXIS));

		JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.LEFT);
		CreateOrderPane.add(tabbedPane_1);

		JPanel FindPpanel = new JPanel();
		tabbedPane_1.addTab("FindProduct", null, FindPpanel, null);
		FindPpanel.setLayout(null);

		JLabel lblNewLabel = new JLabel("Product ID:");
		lblNewLabel.setBounds(10, 11, 67, 14);
		FindPpanel.add(lblNewLabel);

		ProdIDTF = new JTextField();
		ProdIDTF.setBounds(78, 8, 86, 20);
		FindPpanel.add(ProdIDTF);
		ProdIDTF.setColumns(10);

		JLabel lblNewLabel_1 = new JLabel("Quantity:");
		lblNewLabel_1.setBounds(10, 36, 58, 14);
		FindPpanel.add(lblNewLabel_1);

		ProdQNTF = new JTextField();
		ProdQNTF.setBounds(78, 36, 86, 20);
		FindPpanel.add(ProdQNTF);
		ProdQNTF.setColumns(10);

		JButton addProdBut = new JButton("Add");
		addProdBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				int id = Integer.parseInt(ProdIDTF.getText());
				int quant = Integer.parseInt(ProdQNTF.getText());
				orderCtr.findProduct(id, quant);
			}
		});
		addProdBut.setBounds(10, 70, 89, 23);
		FindPpanel.add(addProdBut);

		JButton ResetProdBut = new JButton("Reset");
		ResetProdBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				ProdIDTF.setText("");
				ProdQNTF.setText("");
			}
		});
		ResetProdBut.setBounds(127, 70, 89, 23);
		FindPpanel.add(ResetProdBut);

		List productList = new List();
		productList.setBounds(10, 111, 394, 75);
		FindPpanel.add(productList);

		JButton RemoveProdBut = new JButton("Remove");
		RemoveProdBut.setBounds(263, 70, 89, 23);
		FindPpanel.add(RemoveProdBut);

		JPanel FindCustPane = new JPanel();
		tabbedPane_1.addTab("FindCustomer", null, FindCustPane, null);
		FindCustPane.setLayout(null);

		JLabel lblNewLabel_2 = new JLabel("Customer CPR:");
		lblNewLabel_2.setBounds(10, 11, 89, 14);
		FindCustPane.add(lblNewLabel_2);

		custCPRTF = new JTextField();
		custCPRTF.setBounds(109, 8, 144, 20);
		FindCustPane.add(custCPRTF);
		custCPRTF.setColumns(10);

		JButton addCustBut = new JButton("Add");
		addCustBut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		addCustBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				String cpr = custCPRTF.getText();
				orderCtr.addToOrder(customerCtr.findCustomer(cpr));
			}
		});
		addCustBut.setBounds(20, 44, 89, 23);
		FindCustPane.add(addCustBut);

		JButton resetCustBut = new JButton("Reset");
		resetCustBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				custCPRTF.setText("");
			}
		});
		resetCustBut.setBounds(270, 44, 89, 23);
		FindCustPane.add(resetCustBut);

		JButton removeCustbut = new JButton("Remove");
		removeCustbut.setBounds(147, 44, 89, 23);
		FindCustPane.add(removeCustbut);

		JList addcustList = new JList();
		addcustList.setBounds(0, 130, 404, 55);
		FindCustPane.add(addcustList);

		JButton createInvBut = new JButton("Create Invoice");
		createInvBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				orderCtr.finilizeOrder();
			}
		});
		createInvBut.setBounds(134, 89, 118, 23);
		FindCustPane.add(createInvBut);

		JPanel DeliveryPane = new JPanel();
		tabbedPane_1.addTab("Delivery", null, DeliveryPane, null);
		DeliveryPane.setLayout(null);

		JButton createInvoiceBut = new JButton("Create Invoice");
		createInvoiceBut.setBounds(236, 162, 135, 23);
		DeliveryPane.add(createInvoiceBut);

		JList deliveryCustList = new JList();
		deliveryCustList.setBorder(new TitledBorder(null, "Customer",
				TitledBorder.LEADING, TitledBorder.TOP, null, null));
		deliveryCustList.setBounds(0, 0, 387, 49);
		DeliveryPane.add(deliveryCustList);

		JList DeliveryProdList = new JList();
		DeliveryProdList.setBorder(new TitledBorder(null, "Products",
				TitledBorder.LEADING, TitledBorder.TOP, null,
				new Color(0, 0, 0)));
		DeliveryProdList.setBounds(0, 55, 387, 81);
		DeliveryPane.add(DeliveryProdList);

		JLabel lblDeliverydate = new JLabel("Delivery Date:");
		lblDeliverydate.setBounds(12, 166, 77, 14);
		DeliveryPane.add(lblDeliverydate);

		deliveryDateTF = new JTextField();
		deliveryDateTF.setBounds(99, 162, 86, 20);
		DeliveryPane.add(deliveryDateTF);
		deliveryDateTF.setColumns(10);

		JPanel EditPane = new JPanel();
		tabbedPane.addTab("Edit", null, EditPane, null);
		EditPane.setLayout(new BoxLayout(EditPane, BoxLayout.X_AXIS));

		JTabbedPane tabbedPane_2 = new JTabbedPane(JTabbedPane.LEFT);
		EditPane.add(tabbedPane_2);

		JPanel CreateCustPane = new JPanel();
		tabbedPane_2.addTab("Create Customer", null, CreateCustPane, null);
		CreateCustPane.setLayout(null);

		JLabel lblNewLabel_3 = new JLabel("CPR No:");
		lblNewLabel_3.setBounds(10, 11, 46, 14);
		CreateCustPane.add(lblNewLabel_3);

		JLabel lblNewLabel_4 = new JLabel("First Name: ");
		lblNewLabel_4.setBounds(10, 36, 77, 14);
		CreateCustPane.add(lblNewLabel_4);

		JLabel lblNewLabel_5 = new JLabel("Last Name:");
		lblNewLabel_5.setBounds(10, 61, 77, 14);
		CreateCustPane.add(lblNewLabel_5);

		JLabel lblNewLabel_6 = new JLabel("Address:");
		lblNewLabel_6.setBounds(10, 86, 65, 14);
		CreateCustPane.add(lblNewLabel_6);

		JLabel lblNewLabel_7 = new JLabel("Postal Code:");
		lblNewLabel_7.setBounds(203, 11, 86, 14);
		CreateCustPane.add(lblNewLabel_7);

		JLabel lblNewLabel_8 = new JLabel("Phone Nr:");
		lblNewLabel_8.setBounds(203, 36, 61, 14);
		CreateCustPane.add(lblNewLabel_8);

		JLabel lblNewLabel_9 = new JLabel("Club:");
		lblNewLabel_9.setBounds(203, 61, 61, 14);
		CreateCustPane.add(lblNewLabel_9);

		createCusCPRTF = new JTextField();
		createCusCPRTF.setBounds(85, 8, 86, 20);
		CreateCustPane.add(createCusCPRTF);
		createCusCPRTF.setColumns(10);

		createCusfnameTF = new JTextField();
		createCusfnameTF.setBounds(85, 33, 86, 20);
		CreateCustPane.add(createCusfnameTF);
		createCusfnameTF.setColumns(10);

		createCusLnameTF = new JTextField();
		createCusLnameTF.setBounds(85, 58, 86, 20);
		CreateCustPane.add(createCusLnameTF);
		createCusLnameTF.setColumns(10);

		createCusAddressTF = new JTextField();
		createCusAddressTF.setBounds(85, 83, 86, 20);
		CreateCustPane.add(createCusAddressTF);
		createCusAddressTF.setColumns(10);

		createCusPostalTF = new JTextField();
		createCusPostalTF.setBounds(286, 8, 86, 20);
		CreateCustPane.add(createCusPostalTF);
		createCusPostalTF.setColumns(10);

		createCusPhoneTF = new JTextField();
		createCusPhoneTF.setBounds(286, 33, 86, 20);
		CreateCustPane.add(createCusPhoneTF);
		createCusPhoneTF.setColumns(10);

		createCusClubTF = new JTextField();
		createCusClubTF.setBounds(286, 58, 86, 20);
		CreateCustPane.add(createCusClubTF);
		createCusClubTF.setColumns(10);

		JButton createCusBut = new JButton("Create");
		createCusBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				String cprNo = createCusCPRTF.getText();
				String fName = createCusfnameTF.getText();
				String lName = createCusLnameTF.getText();
				String address = createCusAddressTF.getText();
				String phoneNo = createCusPhoneTF.getText();
				int zipCode = Integer.parseInt(createCusPostalTF.getText());
				int clubNo = Integer.parseInt(createCusClubTF.getText());
				CustomerCtr customerCtr = CustomerCtr.getInstance();
				customerCtr.createCustomer(cprNo, fName, lName, address,
						phoneNo, zipCode, clubNo);
			}
		});
		createCusBut.setBounds(0, 137, 89, 23);
		CreateCustPane.add(createCusBut);

		JButton createCusupdatebut = new JButton("Update");
		createCusupdatebut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				String cprNo = createCusCPRTF.getText();
				String fName = createCusfnameTF.getText();
				String lName = createCusLnameTF.getText();
				String address = createCusAddressTF.getText();
				String phoneNo = createCusPhoneTF.getText();
				int zipCode = Integer.parseInt(createCusPostalTF.getText());
				int clubNo = Integer.parseInt(createCusClubTF.getText());
				CustomerCtr customerCtr = CustomerCtr.getInstance();
				customerCtr.updateCustomer(cprNo, fName, lName, address,
						zipCode, phoneNo, clubNo);
			}
		});
		createCusupdatebut.setBounds(97, 137, 89, 23);
		CreateCustPane.add(createCusupdatebut);

		JButton createCusdelBut = new JButton("Delete");
		createCusdelBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				String cpr = createCusCPRTF.getText();
				CustomerCtr customerCtr = CustomerCtr.getInstance();
				customerCtr.deleteCustomer(cpr);
			}
		});
		createCusdelBut.setBounds(196, 137, 77, 23);
		CreateCustPane.add(createCusdelBut);

		JButton createCusresetBut = new JButton("Reset");
		createCusresetBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				createCusCPRTF.setText("");
				createCusfnameTF.setText("");
				createCusLnameTF.setText("");
				createCusAddressTF.setText("");
				createCusPhoneTF.setText("");
				createCusPostalTF.setText("");
				createCusClubTF.setText("");
			}
		});
		createCusresetBut.setBounds(283, 137, 89, 23);
		CreateCustPane.add(createCusresetBut);

		JPanel createProdPane = new JPanel();
		tabbedPane_2.addTab("Create Product", null, createProdPane, null);
		createProdPane.setLayout(null);

		JLabel lblNewLabel_10 = new JLabel("Product ID: ");
		lblNewLabel_10.setBounds(10, 11, 86, 14);
		createProdPane.add(lblNewLabel_10);

		JLabel lblNewLabel_11 = new JLabel("Product Name:");
		lblNewLabel_11.setBounds(10, 36, 86, 14);
		createProdPane.add(lblNewLabel_11);

		JLabel lblNewLabel_12 = new JLabel("Purchase Price:");
		lblNewLabel_12.setBounds(0, 61, 96, 14);
		createProdPane.add(lblNewLabel_12);

		JLabel lblNewLabel_13 = new JLabel("Sale Price:");
		lblNewLabel_13.setBounds(10, 86, 86, 14);
		createProdPane.add(lblNewLabel_13);

		JLabel lblNewLabel_14 = new JLabel("Rent Price:");
		lblNewLabel_14.setBounds(10, 111, 86, 14);
		createProdPane.add(lblNewLabel_14);

		CreateProdIDTF = new JTextField();
		CreateProdIDTF.setBounds(99, 8, 86, 20);
		createProdPane.add(CreateProdIDTF);
		CreateProdIDTF.setColumns(10);

		CreateProdnameTF = new JTextField();
		CreateProdnameTF.setBounds(99, 33, 86, 20);
		createProdPane.add(CreateProdnameTF);
		CreateProdnameTF.setColumns(10);

		CreateProdPPriceTF = new JTextField();
		CreateProdPPriceTF.setBounds(99, 58, 86, 20);
		createProdPane.add(CreateProdPPriceTF);
		CreateProdPPriceTF.setColumns(10);

		CreateProdSpriceTF = new JTextField();
		CreateProdSpriceTF.setBounds(99, 83, 86, 20);
		createProdPane.add(CreateProdSpriceTF);
		CreateProdSpriceTF.setColumns(10);

		CreateProdRpriceTF = new JTextField();
		CreateProdRpriceTF.setBounds(99, 108, 86, 20);
		createProdPane.add(CreateProdRpriceTF);
		CreateProdRpriceTF.setColumns(10);

		JLabel lblNewLabel_15 = new JLabel("Country:");
		lblNewLabel_15.setBounds(228, 11, 65, 14);
		createProdPane.add(lblNewLabel_15);

		JLabel lblNewLabel_16 = new JLabel("Min Stock: ");
		lblNewLabel_16.setBounds(228, 36, 65, 14);
		createProdPane.add(lblNewLabel_16);

		JLabel lblNewLabel_17 = new JLabel("Current Stock:");
		lblNewLabel_17.setBounds(204, 61, 89, 14);
		createProdPane.add(lblNewLabel_17);

		JLabel lblNewLabel_18 = new JLabel("Suplier CVR:");
		lblNewLabel_18.setBounds(214, 86, 79, 14);
		createProdPane.add(lblNewLabel_18);

		CreateProdcountryTF = new JTextField();
		CreateProdcountryTF.setBounds(293, 8, 86, 20);
		createProdPane.add(CreateProdcountryTF);
		CreateProdcountryTF.setColumns(10);

		CreateProdminstockTF = new JTextField();
		CreateProdminstockTF.setBounds(293, 33, 86, 20);
		createProdPane.add(CreateProdminstockTF);
		CreateProdminstockTF.setColumns(10);

		CreateProdcurrentTF = new JTextField();
		CreateProdcurrentTF.setBounds(293, 58, 86, 20);
		createProdPane.add(CreateProdcurrentTF);
		CreateProdcurrentTF.setColumns(10);

		CreateProdsupcvrTF = new JTextField();
		CreateProdsupcvrTF.setBounds(293, 83, 86, 20);
		createProdPane.add(CreateProdsupcvrTF);
		CreateProdsupcvrTF.setColumns(10);

		JButton CreateProdBut = new JButton("Create");
		CreateProdBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {

				int id = Integer.parseInt(CreateProdIDTF.getText());
				String pName = CreateProdnameTF.getText();
				double pPrice = Double.parseDouble(CreateProdPPriceTF.getText());
				double sPrice = Double.parseDouble(CreateProdSpriceTF.getText());
				double rPrice = Double.parseDouble(CreateProdRpriceTF.getText());
				String origin = CreateProdcountryTF.getText();
				int minStock = Integer.parseInt(CreateProdminstockTF.getText());
				int currentStock = Integer.parseInt(CreateProdcurrentTF
						.getText());
				String supCvr = CreateProdsupcvrTF.getText();
				productCtr.insertNew(pName, pPrice, sPrice, rPrice, origin,
						minStock, currentStock, supCvr, id);
			
			}
		});
		CreateProdBut.setBounds(10, 142, 89, 23);
		createProdPane.add(CreateProdBut);

		JButton CreateProdupdateBut = new JButton("Update");
		CreateProdupdateBut.setBounds(111, 142, 89, 23);
		createProdPane.add(CreateProdupdateBut);

		CreateProdupdateBut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		CreateProdupdateBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				int prodId = Integer.parseInt(CreateProdIDTF.getText());
				String pName = CreateProdnameTF.getText();
				double pPrice = Double.parseDouble(CreateProdPPriceTF.getText());
				double sPrice = Double.parseDouble(CreateProdSpriceTF.getText());
				double rPrice = Double.parseDouble(CreateProdRpriceTF.getText());
				String origin = CreateProdcountryTF.getText();
				int minStock = Integer.parseInt(CreateProdminstockTF.getText());
				int currentStock = Integer.parseInt(CreateProdcurrentTF
						.getText());
				String supCvr = CreateProdsupcvrTF.getText();
				productCtr.updateProduct(pName, pPrice, sPrice, rPrice, origin,
						minStock, currentStock, supCvr, prodId);

			}
		});

		JButton CreateProdDeletebut = new JButton("Delete");
		CreateProdDeletebut.setBounds(222, 142, 89, 23);
		createProdPane.add(CreateProdDeletebut);

		JButton CreateProdseatchBut = new JButton("Search");
		CreateProdseatchBut.setBounds(325, 142, 89, 23);
		createProdPane.add(CreateProdseatchBut);
		CreateProdseatchBut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		CreateProdseatchBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				int id = Integer.parseInt(CreateProdIDTF.getText());
				productCtr.findProduct(id);
			}
		});

		JPanel CreateSupPane = new JPanel();
		tabbedPane_2.addTab("Create Suplier", null, CreateSupPane, null);
		CreateSupPane.setLayout(null);

		JLabel lblNewLabel_19 = new JLabel("CVR:");
		lblNewLabel_19.setBounds(10, 21, 46, 14);
		CreateSupPane.add(lblNewLabel_19);

		JLabel lblNewLabel_20 = new JLabel("Name:");
		lblNewLabel_20.setBounds(10, 46, 46, 14);
		CreateSupPane.add(lblNewLabel_20);

		JLabel lblNewLabel_21 = new JLabel("Address:");
		lblNewLabel_21.setBounds(10, 71, 72, 14);
		CreateSupPane.add(lblNewLabel_21);

		JLabel lblNewLabel_22 = new JLabel("Country:");
		lblNewLabel_22.setBounds(191, 21, 72, 14);
		CreateSupPane.add(lblNewLabel_22);

		JLabel lblNewLabel_23 = new JLabel("Phone:");
		lblNewLabel_23.setBounds(201, 46, 46, 14);
		CreateSupPane.add(lblNewLabel_23);

		JLabel lblNewLabel_24 = new JLabel("Email:");
		lblNewLabel_24.setBounds(199, 71, 38, 14);
		CreateSupPane.add(lblNewLabel_24);

		CreateSupcvrTF = new JTextField();
		CreateSupcvrTF.setBounds(75, 18, 86, 20);
		CreateSupPane.add(CreateSupcvrTF);
		CreateSupcvrTF.setColumns(10);

		CreateSupnameTF = new JTextField();
		CreateSupnameTF.setBounds(75, 43, 86, 20);
		CreateSupPane.add(CreateSupnameTF);
		CreateSupnameTF.setColumns(10);

		CreateSupaddressTF = new JTextField();
		CreateSupaddressTF.setBounds(75, 68, 86, 20);
		CreateSupPane.add(CreateSupaddressTF);
		CreateSupaddressTF.setColumns(10);

		CreateSupCountryTF = new JTextField();
		CreateSupCountryTF.setBounds(256, 18, 86, 20);
		CreateSupPane.add(CreateSupCountryTF);
		CreateSupCountryTF.setColumns(10);

		CreateSupphoneTF = new JTextField();
		CreateSupphoneTF.setBounds(256, 43, 86, 20);
		CreateSupPane.add(CreateSupphoneTF);
		CreateSupphoneTF.setColumns(10);

		CreateSupemailTF = new JTextField();
		CreateSupemailTF.setBounds(256, 68, 86, 20);
		CreateSupPane.add(CreateSupemailTF);
		CreateSupemailTF.setColumns(10);

		JButton CreateSupBut = new JButton("Create");
		CreateSupBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				String cvrNo = CreateSupcvrTF.getText();
				String name = CreateSupnameTF.getText();
				String address = CreateSupaddressTF.getText();
				String country = CreateSupCountryTF.getText();
				String phoneNo = CreateSupphoneTF.getText();
				String email = CreateSupemailTF.getText();
				supplierCtr.createSupplier(cvrNo, name, address, country,
						phoneNo, email);
			}
		});
		CreateSupBut.setBounds(10, 135, 89, 23);
		CreateSupPane.add(CreateSupBut);

		JButton CreateSupupdateBut = new JButton("Update");
		CreateSupupdateBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				String cvrNo = CreateSupcvrTF.getText();
				String name = CreateSupnameTF.getText();
				String address = CreateSupaddressTF.getText();
				String country = CreateSupCountryTF.getText();
				String phoneNo = CreateSupphoneTF.getText();
				String email = CreateSupemailTF.getText();
				supplierCtr.updateSupplier(cvrNo, name, address, country,
						phoneNo, email);
			}
		});
		CreateSupupdateBut.setBounds(116, 135, 89, 23);
		CreateSupPane.add(CreateSupupdateBut);

		JButton CreateSupDelBut = new JButton("Delete");
		CreateSupDelBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				String cvrNo = CreateSupcvrTF.getText();
				supplierCtr.deleteSupplier(cvrNo);
			}
		});
		CreateSupDelBut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		CreateSupDelBut.setBounds(215, 135, 89, 23);
		CreateSupPane.add(CreateSupDelBut);

		JButton CreateSupSearchBut = new JButton("Search");
		CreateSupSearchBut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				String cvrNo = CreateSupcvrTF.getText();
				supplierCtr.findSupplier(cvrNo);
			}
		});
		CreateSupSearchBut.setBounds(314, 135, 89, 23);
		CreateSupPane.add(CreateSupSearchBut);
	}
}
